<style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style>
<template src="./index.html"></template>
<script>
import Reject from "./../reject/index";
export default {
  mixins: [Vue.prototype.$vFN.Mixins.Base, Vue.prototype.$vFN.Mixins.Edit],
  components: {},
  data() {
    return {
      appWindow: window,
      form: {},
      // admin/store/pass
      // admin/store/reject
      // 页面接口地址
      apiUrl: {
        // create: "admin/category/add",
        // update: "admin/category/edit",
        // detail: "admin/category/detail",
      },
    };
  },
  methods: {
    // 初始化
    async init() {
      // 初始化数据
      // await this.mixinEdit_editBoxInit({
      //     model: "form",
      //     id: this.id,
      // })
      // 显示窗口
      this.mixinEdit_editVisible = true;
      this.form = this.data;
    },
    // 驳回审核
    reject(params_) {
      Reject.init({
        mixinEdit_parent: this,
        id: this.data.id,
        data: this.data,
        onSuccess: (res) => {
          this.onSuccess();
        }
      });
    },
    async pass () {
      let res = await this.$vFN.Http.post({
        url: "admin/store/pass",
        data: {
            id: this.data.id
        },
      }, window);
      this.mixinEdit_editVisible = false;
      if (res.success) {
        this.onSuccess();
        this.$vFN.Tools.messageSuccess("操作成功");
      }
    },
    // 成功回调
    onSuccess() {},
    // 取消回调
    onCancel() {},
    // 失败回调
    onError() {},
    // 关闭窗口
    editBoxClose() {
      this.onSuccess();
    },
  },
  mounted() {
    this.init();
  },
  activated() {},
};
</script>